package com.kgc.storeprovider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InventoryProfit;
import com.kgc.store.remote.InventoryProfitRemote;
import com.kgc.storeprovider.service.InventoryLossDetailService;
import com.kgc.storeprovider.service.InventoryProfitService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class InventoryProfitController implements InventoryProfitRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InventoryProfitService inventoryProfitService;
    @Override
    public ResponseMsg getInventoryProfitList(Map<String, Object> map) {
        logger.info("InventoryProfitController getInventoryProfitList map:"+map);
        ResponseMsg msg = inventoryProfitService.getInventoryProfitList(map);
        logger.debug("InventoryProfitController getInventoryProfitList msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg delInventoryProfit(String code) {
        logger.info("InventoryProfitController delInventoryProfit code:"+code);
        ResponseMsg msg = inventoryProfitService.delInventoryProfit(code);
        logger.debug("InventoryProfitController delInventoryProfit msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg insertInventoryProfit(InventoryProfit inventoryProfit) {
        logger.info("InventoryProfitController insertInventoryProfit inventoryProfit:"+inventoryProfit);
        ResponseMsg msg = inventoryProfitService.insertInventoryProfit(inventoryProfit);
        logger.debug("InventoryProfitController insertInventoryProfit msg:"+msg);
        return msg;
    }
}
